namespace Expect.Documentation.Base_concepts
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Data types conversions", Path="\\Base concepts\\Data types conversions.expect")]
    public partial class DataTypesConversionsContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Data types conversions.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void DataTypesConversionsClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [TestCleanup()]
        public virtual void DataTypesConversionsClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        // TestComment
        [TestMethod()]
        public virtual void DataTypesConversions()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_DataTypesConversions(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Data types conversions")]
        public virtual void Get_DataTypesConversions(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Data types conversions";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 1
            fixture.WithRow("Expect manipulate strings. Repeating type conversion code all around would not be" +
                    " very practical, so expect provide a way to declare type conversions.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 3
            fixture.WithRow("For types having \"implicit\" conversion with string (like basics system types int " +
                    "or double), you could just put the type you want in the element (method paramete" +
                    "r, constructor argument, property, ...).");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 5
            fixture.WithRow("For the other types, you must create a public class that implement the interface " +
                    "*IExpectTypeConverter<T>*, T being the target type.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture();
#line 7
            fixture.WithRow("My friend owe me", "10 000,00 $", "");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 9
            fixture.WithRow("In this sample, the string is converted to a custom \"Price\" object.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 11
            fixture.WithRow("If you want to change the way base types are converted, you could declare a type " +
                    "converter for this base type, for example IExpectTypeConverter<DateTime>.");
#line hidden
            fixture.EndRun();

        }
    }
}
